package com.fenghongzhang.day007;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

public class Main5Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main5);

        Intent intent = getIntent();
        //1,直接取值
//        String name = intent.getStringExtra("name");
//        Toast.makeText(this, name, Toast.LENGTH_SHORT).show();

        //2 去bundle对象
//        Bundle extras = intent.getExtras();
//        String name1 = extras.getString("name1");

        //3.变量
//        String name1 =  Main4Activity.name;
//        Map<String,Object> map = Main4Activity.map;
//        String  o = (String) map.get("1");

        //4 app
        MyApp myApp = (MyApp) getApplication();
        String s = myApp.name;

     

        Toast.makeText(this, s, Toast.LENGTH_SHORT).show();
    }
}
